# -*- coding: iso-8859-1 -*-
"""
@newfield project: Project 
@project: yatter
@newfield description: Description 
@description: Twitter Client, based on Python 2.5

@Author: U{Andreas del Galdo<mailto:andreas.delgaldo@mac.com>}
@summary: Creates a tweetView of each tweet
"""

import wx
import logging

def createTweetView(frame, width, height):
    try:
        logging.debug("ui.tweetView.createTweetView()")
        tweetPanel = wx.Panel(frame,-1)
        tweetPanel.SetSize(wx.Size(width,height*0.85))
        tweetPanel.SetPosition(wx.Point(0,height*0.05))
        tweetPanel.SetBackgroundColour(wx.WHITE)
        return tweetPanel
    except:
        logging.debug("ui.tweetView.createTweetView()::ERROR")
        return False

    
def insertData(panel, width, name, text, image):
    try:
        logging.debug("ui.tweetView.insertData()")
        tweetFrame = wx.Panel(panel,-1)
        tweetFrame.SetSize(wx.Size(width,80))
        tweetFrame.SetPosition(wx.Point(0,0))
        tweetFrame.SetWindowStyle(wx.BORDER_SUNKEN)
        #tweetFrame.SetBackgroundColour(wx.GREEN)
        tweetFrame.Show()
        
        lbName = wx.StaticText(tweetFrame,-1,name)
        lbName.SetPosition(wx.Point(width*0.3,5))
        lbName.SetFont(wx.Font(9, wx.SWISS, wx.NORMAL, wx.BOLD, False, 'Verdana'))
        lbName.Show()
        
        lbText = wx.StaticText(tweetFrame,-1,text)
        lbText.SetPosition(wx.Point(width*0.3,20))
        lbText.SetSize(wx.Size(width*0.65,75))
        lbText.SetFont(wx.FONT(7, wx.SWISS, wx.NORMAL, wx.BOLD, False, 'Verdana'))
        lbText.Show()
    except:
        logging.debug("ui.tweetView.insertData()::ERROR")
        return False
